<? if(!defined('IN_ROOT')) exit('Access Denied'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><? $user=$this->user; $setting=$this->setting; ?><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Manyou's Control Panel</title>
        <meta http-equiv="Content-Type" content="text/html; charset=<?=MY_CHARSET?>">
       <link media="all" type="text/css" href="css/common/admin/admincp.css" rel="stylesheet" />
        <script src="js/jquery.js" type="text/javascript"></script>
        <script src="js/admin.js" type="text/javascript"></script>
        <script src="js/calendar.js" type="text/javascript"></script>
    </head>

    <body>

        <div id="append">
        </div>

        <div class="container">
            <? if(isset($message)) { ?>            <? $type=isset($type)?$type:'correctmsg';  ?>            <div class="<?=$type?>"><p><?=$message?></p></div>
            <? } ?>            <h3>门票列表 <a href="index.php?admin_ticket/addrange<?=$setting['seo_suffix']?>" class="sgbtn">门票价格区间</a><a href="index.php?admin_ticket/log<?=$setting['seo_suffix']?>" class="sgbtn">门票订单</a></h3>
            <br />
            <div class="hastabmenu">
                <div class="tabcontentcur" id="srchuserdiv">
                    <form action="index.php?admin_ticket/logsearch<?=$setting['seo_suffix']?>" method="post">
                        <table width="100%">
                            <tr>
                                <td>价格范围:</td>
                                <td>
                                    <select name="pricerange">
                                        <option value="all">全部</option>
                                        
<? if(is_array($ticket_range)) { foreach($ticket_range as $key => $val) { ?>
                                        <option value="<?=$key?>-<?=$val?>"><?=$key?>-<?=$val?></option>
                                        
<? } } ?>
                                    </select>
                                </td>
                                <td>门票名称:</td>
                                <td colspan="2"><input class="txt" name="ticketname"></td>
                            </tr>
                            <tr>
                                <td>订单用户：</td>
                                <td><input class="txt" name="username"></td>
                                <td>订单时间:</td>
                                <td><input class="txt" onclick="showcalendar();" name="srchregdatestart">到&nbsp;<input class="txt" onclick="showcalendar();" name="srchregdateend"></td>
                                <td><input class="btn" name="submit" type="submit" value="确定" /></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
            <br>
            <h4>[共 <?=$ticketlognum?> 个门票订单]</h4>
            <div class="mainbox">
                <form name="userForm" action="index.php?admin_ticket/remove<?=$setting['seo_suffix']?>" method="post">
                    <table class="datalist fixwidth" >
                        <tr>
                            <th><input class="checkbox" id="chkall" onclick="checkall('gid[]')" type="checkbox" name="chkall"><label for="chkall">全选</label></th>
                            <th>门票名称</th>
                            <th>用户名</th>
                            <th>真名</th>
                            <th>地址</th>
                            <th>邮编</th>
                            <th>电话</th>
                            <th>QQ</th>
                            <th>Email</th>
                            <th>备注</th>
                            <th>下单时间</th>
                            <th>状态</th>
                        </tr>
<? if(is_array($loglist)) { foreach($loglist as $log) { ?>
                        <tr>
                            <td class="option"><input class="checkbox" type="checkbox" value="<?=$log['id']?>" name="id[]"></td>
                            <td><strong><?=$log['ticketname']?></strong></td>
                            <td><?=$log['username']?></td>
                            <td><?=$log['realname']?></td>
                            <td><?=$log['address']?></td>
                            <td><?=$log['postcode']?></td>
                            <td><?=$log['phone']?></td>
                            <td><?=$log['qq']?></td>
                            <td><?=$log['email']?></td>
                            <td><?=$log['notes']?></td>
                            <td><?=$log['time']?></td>
                            <td><? if(!$log['status']) { ?><font color="Red">等待评论...</font><? } else { ?><font color="green">已评论</font><? } ?></td>
                        </tr>
<? } } ?>
                        <tr class="nobg">
                            <td colspan="7" class="tdpage"><div class="pages"><?=$departstr?></div></td>
                        </tr>
                        <tr class="nobg">
                            <td colspan="7"><input class="btn" type="button" name="available" onclick="onavailable(1);" value="设为已评论" /></td>
                        </tr>

                    </table>
                </form>
            </div>
        </div>
    </body>
    <script type="text/javascript">
        function onavailable(type){
            if($("input[name='id[]']:checked").length == 0){
                alert('你没有选择任何门票记录！');
                return false;
            }
            document.userForm.action="index.php?admin_ticket/send/"+type+"<?=$setting['seo_suffix']?>";
            document.userForm.submit();
        }
    </script>
</html>
